namespace XEAS.Framework.eCommerce.Paypal
{
    using System;
    using System.IO;
    using System.Net;
    using System.Text;
    using System.Web.UI;

    public class NotifyBasePage : Page
    {
        protected bool _demoMode = true;

        protected bool IsVerifiedNotification()
        {
            string str = "";
            string str2 = base.Request.Form + "&cmd=_notify-validate";
            string requestUriString = this._demoMode ? "https://www.sandbox.paypal.com/us/cgi-bin/webscr" : "https://www.paypal.com/us/cgi-bin/webscr";
            HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = str2.Length;
            StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII);
            writer.Write(str2);
            writer.Close();
            StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream());
            str = reader.ReadToEnd();
            reader.Close();
            return (str == "VERIFIED");
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }
}

